package com.espirit.eap.manager.workflow;

import java.io.Serializable;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToMany;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.GenericGenerator;

import com.espirit.EntityMapping;
import com.espirit.eap.ICheckModelDuplicateInfo;
import com.espirit.eap.manager.processor.BizNodeInfo;
import com.googlecode.cswish.model.Saas;

@Entity
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class WFAutoNode extends EntityMapping implements Serializable, ICheckModelDuplicateInfo , Saas{

	private static final long serialVersionUID = -3861489131506509982L;

	private final static String[] checkProperties = new String[] {"action"};
	
	private String action;
	
	private String name;
	
	private Boolean enable;
	
	private List<BizNodeInfo> nextBizNodes;
	
	private Integer sid;
	public Integer getSid() {
		return sid;
	}

	public void setSid(Integer sid) {
		this.sid = sid;
	}
	
	public String getAction() {
		return action;
	}
	
	public void setAction(String action) {
		this.action = action;
	}
	
	public Boolean getEnable() {
		return enable;
	}
	public void setEnable(Boolean enable) {
		this.enable = enable;
	}
	
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
	
	@ManyToMany(cascade = CascadeType.MERGE, targetEntity = BizNodeInfo.class,fetch=FetchType.LAZY)
	public List<BizNodeInfo> getNextBizNodes() {
		return nextBizNodes;
	}
	
	public void setNextBizNodes(List<BizNodeInfo> nextBizNodes) {
		this.nextBizNodes = nextBizNodes;
	}
	
	@Override
	public String[] gatherProperties() {
		return checkProperties;
	}
	
	private String remark;
	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}
	
}
